import base64

def base64_encode(data):
    return base64.b64encode(data.encode('utf-8')).decode('utf-8')

def base64_decode(data):
    return base64.b64decode(data.encode('utf-8')).decode('utf-8')
print(base64_encode('hello world'))
print(base64_decode('aGVsbG8gd29ybGQ='))
print(base64_decode(base64_encode('hello world')))